<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:p="http://primefaces.prime.com.tr/ui"
      xmlns:c="http://java.sun.com/jsp/jstl/core"
      xmlns:pretty="http://ocpsoft.com/prettyfaces"
      xmlns:ui="http://java.sun.com/jsf/facelets"    
      xmlns:t="http://myfaces.apache.org/tomahawk">

    <h:head>
        <meta HTTP-EQUIV="Content-Type" CONTENT="text/html;charset=UTF-8" />
        <title>New CMS</title>
        <!--<h:outputStylesheet name="#{facesContext.externalContext.request.contextPath}/css/basic.css"/>-->
    </h:head>
    <h:body>
        <ui:composition template="/template/template.xhtml">
            <ui:define name="content">
                <h:form>
                     <h:outputLink value="#{facesContext.externalContext.request.contextPath}/mobile.jsf">
                        Mobile page
                    </h:outputLink>
                    <br/>
                    <h:outputLink value="#{facesContext.externalContext.request.contextPath}/next.jsf">
                        To Next Page
                    </h:outputLink>
                    <h:outputLink value="#{facesContext.externalContext.request.contextPath}/userlist.jsf">
                     Go to user list page
                    </h:outputLink>
                    <br/>

                    <h:inputTextarea cols="60" rows="5" value="#{NewFeedBean.inputUrl}"/>
                    <br/>
                    <h:commandButton value="Share Link" action="#{NewFeedBean.createNewFeed}"/>                    
                    <br/>
                    
                    <ui:repeat value="#{NewFeedBean.newFeedList}" var="list">
                        <h:outputLink target="_blank" value="#{list.url}">
                            <h:outputText escape="false"  value="#{list.subject}"/>
                        </h:outputLink>
                        <h:panelGrid columns="1">
                            <h:outputText   value="#{list.content}"/>
                        </h:panelGrid>
                        <br/>
                        <h:graphicImage  value="#{list.media}"/>
                        <br/>
                        <b><h:outputText value="#{list.datePulished}">
                            </h:outputText></b>
                    </ui:repeat>
                    
                      <!--
                    Image Gallery with primefaces, image switch
                    <a href="#" onclick="imageswitch.previous();">Previous Image</a>
                    <a href="#" onclick="imageswitch.next();">Next Image</a>
                    <br/>
                  
                    <p:imageSwitch effect="SingleDoor" speed="800" slideshowAuto="false" widgetVar="imageswitch">
                        <p:graphicImage  value="/show/IMG_4445.jpg"/>
                        <p:graphicImage  value="/show/IMG_4454.jpg"/>
                        <p:graphicImage  value="/show/IMG_4476.jpg"/>
                        <p:graphicImage  value="/show/IMG_4477.jpg"/>
                        <p:graphicImage  value="/show/IMG_4527.jpg"/>
                        <p:graphicImage  value="/show/IMG_4528.jpg"/>
                        <p:graphicImage  value="/show/IMG_4529.jpg"/>
                        <p:graphicImage  value="/show/IMG_4530.jpg"/>
                        <p:graphicImage  value="/show/IMG_4531.jpg"/>
                        <p:graphicImage  value="/show/IMG_4547.jpg"/>
                    </p:imageSwitch>
                    <br/>
                    <p:imageSwitch effect="ScrollOut" speed="1000" slideshowAuto="true" widgetVar="imageswitch1">
                        <p:graphicImage  value="/show/IMG_4445.jpg"/>
                        <p:graphicImage  value="/show/IMG_4454.jpg"/>
                        <p:graphicImage  value="/show/IMG_4476.jpg"/>
                        <p:graphicImage  value="/show/IMG_4477.jpg"/>
                        <p:graphicImage  value="/show/IMG_4527.jpg"/>
                        <p:graphicImage  value="/show/IMG_4528.jpg"/>
                        <p:graphicImage  value="/show/IMG_4529.jpg"/>
                        <p:graphicImage  value="/show/IMG_4530.jpg"/>
                        <p:graphicImage  value="/show/IMG_4531.jpg"/>
                        <p:graphicImage  value="/show/IMG_4547.jpg"/>
                    </p:imageSwitch>
                    -->

                    <!--
                    Make dinamic from db_>
                      <a href="#" onclick="imageswitch.previous();">#{msgs.prev}</a>
                            <a href="#" onclick="imageswitch.next();">#{msgs.next}</a>
                            <p:imageSwitch effect="SingleDoor" speed="800" slideshowAuto="false" widgetVar="imageswitch">
                                <c:forEach items="#{GalleryBean.galleryList}" var="list">
                                    <p:graphicImage  value="/PreviewImage?w=300&amp;fileId=#{list.imageId}">
                                    </p:graphicImage>
                                </c:forEach>
                            </p:imageSwitch>
                    -->
                </h:form>
            </ui:define>
        </ui:composition>
    </h:body>
</html>
